using SheLife.Domain.Interfaces;
using SheLife.Domain.Interfaces.Repositories;
using SheLife.Infrastructure.Data;
using SheLife.Infrastructure.Repositories;

namespace SheLife.Infrastructure
{
    /// <summary>
    /// 仓储工厂，用于创建和管理仓储实例
    /// </summary>
    public class RepositoryFactory : IRepositoryFactory
    {
        private readonly SheLifeDbContext _context;

        public RepositoryFactory(SheLifeDbContext context)
        {
            _context = context;
        }

        // 用户管理相关仓储
        public IUserRepository CreateUserRepository() => new UserRepository(_context);
        public IMenstrualCycleRepository CreateMenstrualCycleRepository() => new MenstrualCycleRepository(_context);
        public IMenstrualSymptomRepository CreateMenstrualSymptomRepository() => new MenstrualSymptomRepository(_context);
        public IMenstrualNoteRepository CreateMenstrualNoteRepository() => new MenstrualNoteRepository(_context);
        public IBasalBodyTemperatureRepository CreateBasalBodyTemperatureRepository() => new BasalBodyTemperatureRepository(_context);

        // 膳食管理相关仓储
        public IDietRecordRepository CreateDietRecordRepository() => new DietRecordRepository(_context);
        public IDietNutrientRepository CreateDietNutrientRepository() => new DietNutrientRepository(_context);
        public IRecipeRepository CreateRecipeRepository() => new RecipeRepository(_context);
        public IRecipeIngredientRepository CreateRecipeIngredientRepository() => new RecipeIngredientRepository(_context);
        public IRecipeStepRepository CreateRecipeStepRepository() => new RecipeStepRepository(_context);
        public IRecipeNutrientRepository CreateRecipeNutrientRepository() => new RecipeNutrientRepository(_context);
        public IUserRecipeRepository CreateUserRecipeRepository() => new UserRecipeRepository(_context);

        // 护肤管理相关仓储
        public ISkincareRecordRepository CreateSkincareRecordRepository() => new SkincareRecordRepository(_context);
        public ISkincareProductRepository CreateSkincareProductRepository() => new SkincareProductRepository(_context);
        public ISkincareProductRecordRepository CreateSkincareProductRecordRepository() => new SkincareProductRecordRepository(_context);
        public IUserSkincareProductRepository CreateUserSkincareProductRepository() => new UserSkincareProductRepository(_context);
        public ISkincareReminderRepository CreateSkincareReminderRepository() => new SkincareReminderRepository(_context);
        public ISkincarePlanRepository CreateSkincarePlanRepository() => new SkincarePlanRepository(_context);
        public ISkincarePlanStepRepository CreateSkincarePlanStepRepository() => new SkincarePlanStepRepository(_context);
        public IUserSkincarePlanRepository CreateUserSkincarePlanRepository() => new UserSkincarePlanRepository(_context);

        // 穿搭管理相关仓储
        public IClothingRepository CreateClothingRepository() => new ClothingRepository(_context);
        public IOutfitRepository CreateOutfitRepository() => new OutfitRepository(_context);
        public IOutfitClothingRepository CreateOutfitClothingRepository() => new OutfitClothingRepository(_context);
        public IOutfitRecordRepository CreateOutfitRecordRepository() => new OutfitRecordRepository(_context);
        public IOutfitTemplateRepository CreateOutfitTemplateRepository() => new OutfitTemplateRepository(_context);
        public IOutfitTemplateItemRepository CreateOutfitTemplateItemRepository() => new OutfitTemplateItemRepository(_context);
        public IUserOutfitTemplateRepository CreateUserOutfitTemplateRepository() => new UserOutfitTemplateRepository(_context);
        public IOutfitSuggestionRepository CreateOutfitSuggestionRepository() => new OutfitSuggestionRepository(_context);

        // 成长管理相关仓储
        public IGrowthGoalRepository CreateGrowthGoalRepository() => new GrowthGoalRepository(_context);
        public IGrowthGoalTaskRepository CreateGrowthGoalTaskRepository() => new GrowthGoalTaskRepository(_context);
        public IGrowthGoalRecordRepository CreateGrowthGoalRecordRepository() => new GrowthGoalRecordRepository(_context);
        public IGrowthGoalTaskRecordRepository CreateGrowthGoalTaskRecordRepository() => new GrowthGoalTaskRecordRepository(_context);
        public IGrowthArchiveRepository CreateGrowthArchiveRepository() => new GrowthArchiveRepository(_context);
        public IGrowthArchiveItemRepository CreateGrowthArchiveItemRepository() => new GrowthArchiveItemRepository(_context);
        public IEmotionDiaryRepository CreateEmotionDiaryRepository() => new EmotionDiaryRepository(_context);
        public IEmotionDiaryCommentRepository CreateEmotionDiaryCommentRepository() => new EmotionDiaryCommentRepository(_context);
        public IEmotionDiaryLikeRepository CreateEmotionDiaryLikeRepository() => new EmotionDiaryLikeRepository(_context);
        public IGrowthCourseRepository CreateGrowthCourseRepository() => new GrowthCourseRepository(_context);
        public IGrowthCourseLessonRepository CreateGrowthCourseLessonRepository() => new GrowthCourseLessonRepository(_context);
        public IUserGrowthCourseRepository CreateUserGrowthCourseRepository() => new UserGrowthCourseRepository(_context);
        public IUserGrowthCourseProgressRepository CreateUserGrowthCourseProgressRepository() => new UserGrowthCourseProgressRepository(_context);
        public IGrowthCourseReviewRepository CreateGrowthCourseReviewRepository() => new GrowthCourseReviewRepository(_context);

        // 社区社交相关仓储
        public ICommunityPostRepository CreateCommunityPostRepository() => new CommunityPostRepository(_context);
        public ICommunityPostCommentRepository CreateCommunityPostCommentRepository() => new CommunityPostCommentRepository(_context);
        public ICommunityPostLikeRepository CreateCommunityPostLikeRepository() => new CommunityPostLikeRepository(_context);
        public ICommunityPostCollectionRepository CreateCommunityPostCollectionRepository() => new CommunityPostCollectionRepository(_context);
        public ICommunityCategoryRepository CreateCommunityCategoryRepository() => new CommunityCategoryRepository(_context);
        public ICommunityTagRepository CreateCommunityTagRepository() => new CommunityTagRepository(_context);
        public IUserFriendRepository CreateUserFriendRepository() => new UserFriendRepository(_context);
        public IUserFollowRepository CreateUserFollowRepository() => new UserFollowRepository(_context);
        public IUserMessageRepository CreateUserMessageRepository() => new UserMessageRepository(_context);
        public ICommunityGroupRepository CreateCommunityGroupRepository() => new CommunityGroupRepository(_context);
        public ICommunityGroupMemberRepository CreateCommunityGroupMemberRepository() => new CommunityGroupMemberRepository(_context);
        public ICommunityGroupPostRepository CreateCommunityGroupPostRepository() => new CommunityGroupPostRepository(_context);

        // 通知提醒相关仓储
        public INotificationRepository CreateNotificationRepository() => new NotificationRepository(_context);
        public IReminderRepository CreateReminderRepository() => new ReminderRepository(_context);
        public IReminderHistoryRepository CreateReminderHistoryRepository() => new ReminderHistoryRepository(_context);
        public IUserNotificationSettingRepository CreateUserNotificationSettingRepository() => new UserNotificationSettingRepository(_context);
        public IMessageTemplateRepository CreateMessageTemplateRepository() => new MessageTemplateRepository(_context);
        public IMessageSendLogRepository CreateMessageSendLogRepository() => new MessageSendLogRepository(_context);

        // 系统设置相关仓储
        public ISystemConfigRepository CreateSystemConfigRepository() => new SystemConfigRepository(_context);
        public ISystemLogRepository CreateSystemLogRepository() => new SystemLogRepository(_context);
        public ISystemTaskRepository CreateSystemTaskRepository() => new SystemTaskRepository(_context);
        public ISystemTaskLogRepository CreateSystemTaskLogRepository() => new SystemTaskLogRepository(_context);
        public ISystemNotificationRepository CreateSystemNotificationRepository() => new SystemNotificationRepository(_context);
        public ISystemPermissionRepository CreateSystemPermissionRepository() => new SystemPermissionRepository(_context);
        public ISystemRoleRepository CreateSystemRoleRepository() => new SystemRoleRepository(_context);
        public ISystemUserRoleRepository CreateSystemUserRoleRepository() => new SystemUserRoleRepository(_context);
        public ISystemRolePermissionRepository CreateSystemRolePermissionRepository() => new SystemRolePermissionRepository(_context);
        public ISystemMenuRepository CreateSystemMenuRepository() => new SystemMenuRepository(_context);
        public ISystemRoleMenuRepository CreateSystemRoleMenuRepository() => new SystemRoleMenuRepository(_context);
        public ISystemDictionaryRepository CreateSystemDictionaryRepository() => new SystemDictionaryRepository(_context);
        public ISystemOperationLogRepository CreateSystemOperationLogRepository() => new SystemOperationLogRepository(_context);
        public ISystemLoginLogRepository CreateSystemLoginLogRepository() => new SystemLoginLogRepository(_context);
        public ISystemFileRepository CreateSystemFileRepository() => new SystemFileRepository(_context);
    }
}